<template>
    <h1>用户理财明细</h1>

    <table>
        <thead style="background-color: aqua;">
            <tr>
                <th>用户登录账号</th>
                <th>理财产品名称</th>
                <th>年收益</th>
                <th>购买金额</th>
                <th>购买时间</th>
            </tr>
        </thead>

        <tbody>
            <tr  v-for="item in Info">
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.F_FName }}</td>
                <td>{{ item.F_YearMoney }}</td>
                <td>{{ item.UF_Money }}</td>
                <td>{{ item.UF_Date }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const route = useRoute();

const Info = ref([{
    UF_Money:'',
    UF_Date:'',
    F_FName:'',
    F_YearMoney:'',
    UL_Name:''
}])

console.log(route.params.Id);

onMounted(()=>{
    UserFinancingAlis();
})

const UserFinancingAlis = ()=>{
    axios({
        method:'get',
        url:'http://localhost:63517/api/Finan/UserFinancingAlis',
        params:{
            Id:route.params.Id
        }
    })
    .then(res=>{
        console.log(res.data);
        Info.value = res.data;
    })
    .catch(err=>{
        console.log(err);
    })
}

</script>